<template>
  <div class="container">
    <Category title="游戏">
      <!-- 接收插槽传递的数据 -->
      <!-- 第一种写法 -->
      <!-- <template scope="{games}"> -->
      <!-- 第二种写法 -->
      <template slot-scope="{ games }">
        <ul>
          <li v-for="(game, index) in games" :key="index">{{ game }}</li>
        </ul>
      </template>
    </Category>
    <Category title="游戏">
      <!-- 接收插槽传递的数据 -->
      <template scope="{games}">
        <ol>
          <li v-for="(game, index) in games" :key="index">{{ game }}</li>
        </ol>
      </template>
    </Category>
    <Category title="游戏">
      <!-- 接收插槽传递的数据,使用数据解析 -->

      <template scope="{games}">
        <h4>
          <li v-for="(game, index) in games" :key="index">{{ game }}</li>
        </h4>
      </template>
    </Category>
  </div>
</template>

<script>
import Category from "./components/Category.vue";
export default {
  name: "App",
  components: { Category },
};
</script>
<style>
.container,
.foot {
  display: flex;
  justify-content: space-around;
}
img {
  width: 100%;
}
video {
  width: 100%;
}
h4 {
  text-align: center;
}
</style>




